import cv2

print("OpenCV版本:", cv2.__version__)

# 尝试读取一张图片
try:
    img = cv2.imread("test.jpg")
    if img is not None:
        print("成功读取图片！图片形状:", img.shape)
        # 显示图片
        cv2.imshow("Test Image", img)
        cv2.waitKey(0)
        cv2.destroyAllWindows()
    else:
        print("无法读取图片，请确保test.jpg文件存在于当前目录")
except Exception as e:
    print("读取图片时出错:", e)

print("OpenCV测试完成")